import Taro from "@tarojs/taro";

export function setTabBarState(index:number){
    let currentInstance = Taro.getCurrentInstance();
    let page = currentInstance.page;

    if (page?.getTabBar){
        let tabBar = Taro.getTabBar(page);
        if (tabBar){
            // @ts-ignore
            tabBar.setState({
                selected: index
            })
        }
    }
}

